<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<div th:replace="XAdmin/commons/header"></div>
<link rel="stylesheet" th:href="@{/XAdmin/css/style.css}">
<style>
    [v-cloak] {
        opacity: 0;
    }

    .x-admin-carousel li {
        text-align: center;
        margin-left: 7%;
    }
</style>
<body>
<div id="app" class="layui-fluid">
    <div v-cloak class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body">
                    <blockquote style="text-align: center;font-size: large" class="layui-elem-quote">
                        <b>当前时间: <span id="currentDate"></span></b> <a class="layui-btn layui-btn-small"
                                                                       style="line-height:1.6em;margin-top:-8px;float:right"
                                                                       onclick="location.reload()" title="刷新">
                        <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
                    </blockquote>

                </div>
            </div>
<!--            <div class="layui-card">-->
<!--                <div class="layui-card-header">数据统计</div>-->
<!--                <div class="layui-card-body ">-->
<!--                    <ul class="layui-row layui-col-space10 layui-this x-admin-carousel x-admin-backlog">-->
<!--                        <li class="layui-col-md2 layui-col-xs6">-->
<!--                            <a href="javascript:;" class="x-admin-backlog-body">-->
<!--                                <h3>用户总数</h3>-->
<!--                                <p>-->
<!--                                    <cite>100{{dataStatistics.userCount}}</cite></p>-->
<!--                            </a>-->
<!--                        </li>-->
<!--                        <li class="layui-col-md2 layui-col-xs6">-->
<!--                            <a href="javascript:;" class="x-admin-backlog-body">-->
<!--                                <h3>群总数</h3>-->
<!--                                <p>-->
<!--                                    <cite>100{{dataStatistics.userCount}}</cite></p>-->
<!--                            </a>-->
<!--                        </li>-->
<!--                        <li class="layui-col-md2 layui-col-xs6">-->
<!--                            <a href="javascript:;" class="x-admin-backlog-body">-->
<!--                                <h3>阅读总数</h3>-->
<!--                                <p>-->
<!--                                    <cite>100{{dataStatistics.checkEnterpriseCount}}</cite></p>-->
<!--                            </a>-->
<!--                        </li>-->
<!--                        <li class="layui-col-md2 layui-col-xs6">-->
<!--                            <a href="javascript:;" class="x-admin-backlog-body">-->
<!--                                <h3>通知总数</h3>-->
<!--                                <p>-->
<!--                                    <cite>100{{dataStatistics.checkEnterpriseCount}}</cite></p>-->
<!--                            </a>-->
<!--                        </li>-->
<!--                    </ul>-->
<!--                </div>-->
<!--            </div>-->
        </div>
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">系统信息</div>
                <div class="layui-card-body ">
                    <table class="layui-table">
                        <tbody>
                        <!--                        <tr>-->
                        <!--                            <th>用户名</th>-->
                        <!--                            <td>{{sys.userName}}</td>-->
                        <!--                        </tr>-->
                        <!--                        <tr>-->
                        <!--                            <th>计算机名</th>-->
                        <!--                            <td>{{sys.computerName}}</td>-->
                        <!--                        </tr>-->
                        <tr>
                            <th>操作系统名称</th>
                            <td>{{sys.osName}}</td>
                        </tr>
                        <tr>
                            <th>操作系统版本</th>
                            <td>{{sys.osVersion}}</td>
                        </tr>
                        <tr>
                            <th>操作系统构架</th>
                            <td>{{sys.osArch}}</td>
                        </tr>
                        <tr>
                            <th>Java运行环境</th>
                            <td>{{sys.javaVersion}}</td>
                        </tr>
                        <tr>
                            <th>JVM总内存</th>
                            <td>{{sys.totalMemory}}</td>
                        </tr>
                        <tr>
                            <th>JVM剩余内存</th>
                            <td style="color: green">{{sys.freeMemory}}</td>
                        </tr>

                        <tr>
                            <th>IP</th>
                            <td>{{sys.ip}}</td>
                        </tr>
                        <tr>
                            <th>MySQL版本</th>
                            <td>5.7.21</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <!--        <div class="layui-col-md12">-->
        <!--            <blockquote class="layui-elem-quote layui-quote-nm">感谢layui,百度Echarts,jquery,本系统由x-admin提供技术支持。</blockquote>-->
        <!--        </div>-->
    </div>
</div>

<script type="text/javascript" th:src="@{/XAdmin/js/echarts.min.js}"></script>
<script type="text/javascript" th:src="@{/XAdmin/js/echarts.common.min.js}"></script>
<script>
    new Vue({
        el: '#app',
        data: {
            sys: {},
            dataStatistics: {}
        },
        mounted() {
            this.findSysInfo();
            // this.findDataStatistics();
            // setInterval(()=>{
            //     this.findDataStatistics();
            //     this.findSysInfo();
            // },5000)
        },
        methods: {
            findSysInfo() {
                let request = {
                    url: '/sys/findInfo',
                    data: {}
                };
                sendRequest(request, (res) => {
                    this.sys = res.data;
                })
            },
            findDataStatistics() {
                let request = {
                    url: '/sys/findDataStatistics',
                    data: {}
                };
                sendRequest(request, (res) => {
                    this.dataStatistics = res.data;
                })
            }

        }
    });
    writeCurrentDate();

</script>

</body>
</html>